API: gdk: Don't track outstanding surfaces
authorBenjamin Otte <otte@redhat.com>
Thu, 7 Oct 2010 19:32:05 +0000 (21:32 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 Dec 2010 19:17:28 +0000 (20:17 +0100)
You are not allowed to track surfaces from GDK or draw outside of expose
events. So we can remove ugly hacks needed previously. See
https://bugzilla.gnome.org/show_bug.cgi?id=606009 for the introduction
of this workaround.

gdk/gdkinternals.h
gdk/gdkwindow.c

index c425447871db18c59436addd710aaf33c11c8feb..f25672fd58c190d835d27157d3bd809eaf0e6292 100644 (file)
@@ -267,7 +267,6 @@ struct _GdkWindowObject
   cairo_region_t *input_shape;
   
   cairo_surface_t *cairo_surface;
-  guint outstanding_surfaces; /* only set on impl window */
 
   GList *devices_inside;
   GHashTable *device_events;
index e3d401368f8034dbcff66dcd17bae55435ee2f63..776a03bf10189eaf57de39365bbc377db177cc79 100644 (file)
@@ -2784,9 +2784,6 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
       private->implicit_paint != NULL)
     return FALSE; /* Don't stack implicit paints */
 
-  if (private->outstanding_surfaces != 0)
-    return FALSE; /* May conflict with direct drawing to cairo surface */
-
   /* Never do implicit paints for foreign windows, they don't need
    * double buffer combination since they have no client side children,
    * and creating surfaces for them is risky since they could disappear
@@ -3393,11 +3390,7 @@ move_region_on_impl (GdkWindowObject *impl_window,
       cairo_region_destroy (exposing);
     }
 
-  if (impl_window->outstanding_surfaces == 0) /* Enable flicker free handling of moves. */
-    append_move_region (impl_window, region, dx, dy);
-  else
-    do_move_region_bits_on_impl (impl_window,
-                                region, dx, dy);
+  append_move_region (impl_window, region, dx, dy);
 
   cairo_region_destroy (region);
 }
@@ -3702,7 +3695,6 @@ gdk_window_cairo_surface_destroy (void *data)
   GdkWindowObject *private = (GdkWindowObject*) data;
 
   private->cairo_surface = NULL;
-  private->impl_window->outstanding_surfaces--;
 }
 
 static cairo_surface_t *
@@ -3754,8 +3746,6 @@ gdk_window_ref_cairo_surface (GdkDrawable *drawable)
 
          if (private->cairo_surface)
            {
-             private->impl_window->outstanding_surfaces++;
-
              cairo_surface_set_user_data (private->cairo_surface, &gdk_window_cairo_key,
                                           drawable, gdk_window_cairo_surface_destroy);
            }